package behavior.strategy.versionTwo;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;

/**
 * @author huhaiqiang
 * @version V1.0
 * @description 现金收费工厂
 * @date 2018/12/03 15:13
 */
@Slf4j
public class CashFactory {

    public static CashSuper createCashAccept(int type) {
        CashSuper cashSuper = null;

        switch (type) {
            case 1:
                cashSuper = new CashNormal();
                log.info("当前没有活动");
                break;
            case 2:
                cashSuper = new CashReturn(new BigDecimal("300"),new BigDecimal("100"));
                log.info("当前活动为：满300减100");
                break;
            case 3:
                cashSuper = new CashRebate("0.8");
                log.info("当前活动为：打八折");
                break;
            default:
        }
        return cashSuper;
    }
}
